fix(function): align JSON operator string comparison with MySQL semantics#24018
Merged
mergify[bot] merged 7 commits intomainfrom Apr 27, 2026
Merged
fix(function): align JSON operator string comparison with MySQL semantics#24018mergify[bot] merged 7 commits intomainfrom
mergify[bot] merged 7 commits intomainfrom
Conversation
1 task
|
|
Agent-Logs-Url: https://github.com/matrixorigin/matrixone/sessions/835b4c63-fcff-4a02-8495-db4c987c10c7 Co-authored-by: aptend <49832303+aptend@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix wrong result with '->' operator in SQL query
Fix JSON Mar 30, 2026
-> operator string comparison to match MySQL semantics
…affected test files Agent-Logs-Url: https://github.com/matrixorigin/matrixone/sessions/a10b449d-aa4d-4c17-9dc3-720e16ecf4ed Co-authored-by: aptend <49832303+aptend@users.noreply.github.com>
-> operator string comparison to match MySQL semantics
Contributor
Merge Queue Status
This pull request spent 25 seconds in the queue, including 3 seconds running CI. Required conditions to merge
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
issue #23935
What this PR does / why we need it:
The
->JSON extract operator followed by comparison (>,<,>=,<=) was silently casting JSON to VARCHAR and performing string comparison, which deviates from MySQL behavior. MySQL returns an error for JSON-to-string ordering comparisons.Changes:
jsonOrderingWithStringNotSupportedhelper infunc_compare.goand applied it inlist_operator.goto restore the JSON+string ordering error for>,<,>=,<=andBETWEEN.=comparison on JSON-extracted strings to use unquoted values ('CODE-3'instead of'"CODE-3"'), matching MySQL semantics.MarshalJSONerrors injsonToStrinstead of silently ignoring them.func_json_extract.test,func_like.test, androw_constructor.sqlto reflect the corrected behavior.